<?php
defined('_JEXEC') or die( 'Restricted access' );

class igphotoModelEdit_photo extends igbaseModel
{
	protected $context = 'edit_photo';
	
	function __construct()
	{
		parent::__construct();
	}

	function getPhoto()
	{
		$query = 'SELECT '.
		'#__igallery_img.*, '.
		'#__igallery.name, '.
		'#__igallery_profiles.max_width, #__igallery_profiles.max_height, #__igallery_profiles.thumb_width, '.
		'#__igallery_profiles.thumb_height, #__igallery_profiles.crop_thumbs, #__igallery_profiles.img_quality, '.
		'#__igallery_profiles.watermark, #__igallery_profiles.watermark_filename, #__igallery_profiles.watermark_position, '.
		'#__igallery_profiles.watermark_transparency, #__igallery_profiles.round_thumb, #__igallery_profiles.round_fill '.
		'FROM #__igallery_img '.
		'INNER JOIN #__igallery ON #__igallery.id = #__igallery_img.gallery_id '.
		'INNER JOIN #__igallery_profiles ON #__igallery_profiles.id = #__igallery.profile '.
		'WHERE #__igallery_img.id = '. (int)$this->_id;
		$this->_db->setQuery($query);
		$this->_photo = $this->_db->loadObject();
		return $this->_photo;
	}

}